/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "news_extends_firstchannel_channels")
//@NamedQueries({@NamedQuery(name = "NewsExtendsFirstchannelChannels.findAll", query = "SELECT n FROM NewsExtendsFirstchannelChannels n"), @NamedQuery(name = "NewsExtendsFirstchannelChannels.findByChannelid", query = "SELECT n FROM NewsExtendsFirstchannelChannels n WHERE n.newsExtendsFirstchannelChannelsPK.channelid = :channelid"), @NamedQuery(name = "NewsExtendsFirstchannelChannels.findByChannleid", query = "SELECT n FROM NewsExtendsFirstchannelChannels n WHERE n.newsExtendsFirstchannelChannelsPK.channleid = :channleid"), @NamedQuery(name = "NewsExtendsFirstchannelChannels.findByChannelorder", query = "SELECT n FROM NewsExtendsFirstchannelChannels n WHERE n.channelorder = :channelorder")})
public class NewsExtendsFirstchannelChannels implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected NewsExtendsFirstchannelChannelsPK newsExtendsFirstchannelChannelsPK;
    @Column(name = "channelorder")
    private Integer channelorder;
    @JoinColumn(name = "channleid", referencedColumnName = "channleid", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private NewsExtendsChannel newsExtendsChannel;
    @JoinColumn(name = "channelid", referencedColumnName = "channelid", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private NewsExtendsFirstchannel newsExtendsFirstchannel;

    public NewsExtendsFirstchannelChannels() {
    }

    public NewsExtendsFirstchannelChannels(NewsExtendsFirstchannelChannelsPK newsExtendsFirstchannelChannelsPK) {
        this.newsExtendsFirstchannelChannelsPK = newsExtendsFirstchannelChannelsPK;
    }

    public NewsExtendsFirstchannelChannels(int channelid, int channleid) {
        this.newsExtendsFirstchannelChannelsPK = new NewsExtendsFirstchannelChannelsPK(channelid, channleid);
    }

    public NewsExtendsFirstchannelChannelsPK getNewsExtendsFirstchannelChannelsPK() {
        return newsExtendsFirstchannelChannelsPK;
    }

    public void setNewsExtendsFirstchannelChannelsPK(NewsExtendsFirstchannelChannelsPK newsExtendsFirstchannelChannelsPK) {
        this.newsExtendsFirstchannelChannelsPK = newsExtendsFirstchannelChannelsPK;
    }

    public Integer getChannelorder() {
        return channelorder;
    }

    public void setChannelorder(Integer channelorder) {
        this.channelorder = channelorder;
    }

    public NewsExtendsChannel getNewsExtendsChannel() {
        return newsExtendsChannel;
    }

    public void setNewsExtendsChannel(NewsExtendsChannel newsExtendsChannel) {
        this.newsExtendsChannel = newsExtendsChannel;
    }

    public NewsExtendsFirstchannel getNewsExtendsFirstchannel() {
        return newsExtendsFirstchannel;
    }

    public void setNewsExtendsFirstchannel(NewsExtendsFirstchannel newsExtendsFirstchannel) {
        this.newsExtendsFirstchannel = newsExtendsFirstchannel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (newsExtendsFirstchannelChannelsPK != null ? newsExtendsFirstchannelChannelsPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewsExtendsFirstchannelChannels)) {
            return false;
        }
        NewsExtendsFirstchannelChannels other = (NewsExtendsFirstchannelChannels) object;
        if ((this.newsExtendsFirstchannelChannelsPK == null && other.newsExtendsFirstchannelChannelsPK != null) || (this.newsExtendsFirstchannelChannelsPK != null && !this.newsExtendsFirstchannelChannelsPK.equals(other.newsExtendsFirstchannelChannelsPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.NewsExtendsFirstchannelChannels[newsExtendsFirstchannelChannelsPK=" + newsExtendsFirstchannelChannelsPK + "]";
    }

}
